<!--我的房源页面-->
<template>
  <div class="housing">
    <!--楼盘-->
    <div v-if="housing">
      <div class="housing-properties">
        <!--tab切换-->
        <div class="housing-tab">
          <div @click="cur=0" class="housing-tab-list" :class="{active:cur==0}">楼盘</div>
          <div
            @click="getReleaseCommunity(1)"
            class="housing-tab-list"
            :class="{active:cur==1}"
            v-show="userInfo.companyType == 0"
          >联合办公</div>
        </div>
        <!--楼盘主体内容-->
        <div class="housing-properties-cont" v-show="cur==0">
          <div class="housing-list-tab">
            <div
              @click="getReleaseHouse(1)"
              :class="{acitvelist:son==1}"
              class="housing-list-tab-item"
            >发布中 ({{statusNum.releaseNum}})</div>
            <div
              @click="getReleaseHouse(0)"
              :class="{acitvelist:son==0}"
              class="housing-list-tab-item"
            >草稿箱 ({{statusNum.draftNum}})</div>
            <div
              @click="getReleaseHouse(2)"
              :class="{acitvelist:son==2}"
              class="housing-list-tab-item"
            >已下架 ({{statusNum.soldoutNum}})</div>
            <div class="search">
              <div class="search-input">
                <el-input
                  placeholder="请输入搜索内容…"
                  prefix-icon="el-icon-search"
                  v-model="buildingQuery.keyword"
                ></el-input>
              </div>
              <div class="search-bt">
                <el-button type="primary" @click="getReleaseHouse(3)">搜索</el-button>
              </div>
              <div class="search-bt">
                <el-button type="primary" @click="addproperties(0)">创建房源</el-button>
              </div>
            </div>
          </div>
          <!-- <div class="shuxin">
            <p class="">今日房源刷新与发布剩余{{surplusNum}}次</p>
            <p class="">
              上架房源自动刷新20次
              <el-radio-group v-model="sxradio" @change="sxChange()" style="margin-left:30px;">
                <el-radio :label="1">立即执行</el-radio>
                <el-radio :label="2">选时执行</el-radio>
              </el-radio-group>
                <el-time-picker
                  v-show="timeShow"
                  style="margin-left:30px;"
                  is-range
                  v-model="sxdata"
                  range-separator="-"
                  format='HH:mm'
                  start-placeholder="开始时间"
                  end-placeholder="结束时间"
                  placeholder="选择时间范围">
                </el-time-picker>
              <el-button style="margin-left:30px;" size="mini" round>执行</el-button>
            </p>
          </div>-->
          <!--楼盘发布中-->
          <div class="housing-properties-item">
            <div class="housing-properties-tab">
              <el-table
                :data="builHouseList"
                style="width: 100%;"
                :header-cell-style="{color:'#98A9BC'}"
                @sort-change="areaSort"
              >
                <el-table-column type="index" align="left" min-width="80"></el-table-column>
                <el-table-column label="房源标题" align="left" min-width="170">
                  <template slot-scope="scope">
                    <div class="house-title">{{scope.row.houseTitle}}</div>
                  </template>
                </el-table-column>
                <!-- <el-table-column label="房源标题" align="left" min-width="170">
                  <template slot-scope="scope">
                    <div class="house-title">{{scope.row.houseTitle}}</div>
                  </template>
                </el-table-column>-->
                <el-table-column
                  v-show="userInfo.companyType!=3"
                  label="楼号"
                  align="left"
                  prop="buildingNo"
                  min-width="80"
                ></el-table-column>
                <el-table-column
                  v-if="userInfo　&& userInfo.companyType != 3"
                  label="房号"
                  align="left"
                  prop="roomNo"
                  min-width="80"
                ></el-table-column>
                <el-table-column
                  label="面积 (㎡)"
                  sortable="custom"
                  align="left"
                  prop="area"
                  min-width="100"
                ></el-table-column>
                <el-table-column label="单价 (￥)" sortable align="left" prop="price" min-width="98"></el-table-column>
                <el-table-column
                  label="更新时间"
                  align="left"
                  prop="updateTime"
                  min-width="180"
                  sortable
                ></el-table-column>
                <el-table-column label="操作" fixed="right" align="left" min-width="210">
                  <template slot-scope="scope">
                    <el-button
                      @click="viewBuiHouse(scope.row,1)"
                      type="text"
                      size="small"
                      v-show="scope.row.selfFlag == 1"
                    >编辑</el-button>
                    <el-button
                      size="mini"
                      v-show="scope.row.status==1 && scope.row.selfFlag == 1"
                      @click="fallBuiHouse(scope.row,'2','下架')"
                      type="text"
                    >下架</el-button>
                    <el-button
                      size="mini"
                      v-show="scope.row.status!=1 && scope.row.selfFlag == 1"
                      @click="fallBuiHouse(scope.row,'1','上架')"
                      type="text"
                    >上架</el-button>
                    <el-button
                      size="mini"
                      @click="delBuildingHouse(scope.row.houseId)"
                      type="text"
                      v-show="limitDelete(scope.row)"
                    >删除</el-button>
                    <el-button
                      size="mini"
                      v-show="scope.row.recommendFlag==1 && scope.row.status == 1 && userInfo && limitType()"
                      @click="recommendHouse(scope.row,0,'取消推荐')"
                      type="text"
                    >取消推荐</el-button>
                    <el-button
                      size="mini"
                      v-show="scope.row.recommendFlag==0 && scope.row.status==1 && userInfo && limitType()"
                      @click="recommendHouse(scope.row,1,'推荐')"
                      type="text"
                    >推荐</el-button>
                    <el-button
                      size="mini"
                      v-show="scope.row.selfFlag == 1 && userInfo && userInfo.companyType==3"
                      @click="refresh(scope.row)"
                      type="text"
                    >刷新</el-button>
                  </template>
                </el-table-column>
              </el-table>
            </div>
            <div class="housing-properties-page">
              <!-- <el-pagination background layout="prev, pager, next" :total="buildingTotal"></el-pagination> -->
              <el-pagination
                @size-change="(val) => {buildingQuery.size=val;getReleaseHouse(3)}"
                @current-change="(val) => {buildingQuery.page=val;getReleaseHouse(3)}"
                background
                :page-sizes="[10, 20, 30, 40]"
                :page-size="buildingQuery.size"
                :current-page.sync="buildingQuery.page"
                layout="total, sizes, prev, pager, next"
                :total="buildingTotal"
              ></el-pagination>
            </div>
          </div>
        </div>
      </div>
      <!--联合办公-->
      <div class="housing-union" v-show="cur==1">
        <div class="housing-union-cont">
          <div class="housing-list-tab">
            <!-- <div @click="con=0" :class="{acitvelist:con==0}" class="housing-list-tab-item">发布中 (8)</div>
            <div @click="con=1" :class="{acitvelist:con==1}" class="housing-list-tab-item">草稿箱 (10)</div>
            <div @click="con=2" :class="{acitvelist:con==2}" class="housing-list-tab-item">已下架 (6)</div>-->
            <div class="search">
              <div class="search-input">
                <el-input
                  placeholder="请输入搜索内容…"
                  prefix-icon="el-icon-search"
                  v-model="communityQuery.keyword"
                ></el-input>
              </div>
              <div class="search-bt">
                <el-button type="primary" @click="getReleaseCommunity()">搜索</el-button>
              </div>
              <div class="search-bt">
                <el-button type="primary" @click="addunion(0)">创建联合办公</el-button>
              </div>
            </div>
          </div>
          <div class="housing-union-item" v-show="con==0" style="margin-top:50px;">
            <!-- <div class="housing-properties-title">XXXXXX楼盘</div> -->
            <div class="housing-properties-tab">
              <el-table
                :data="communityData"
                style="width: 100%;"
                :header-cell-style="{color:'#98A9BC'}"
              >
                <el-table-column label="序号" align="center" type="index" min-width="10%"></el-table-column>
                <el-table-column label="品牌" align="center" prop="brandName" min-width="20%"></el-table-column>
                <el-table-column label="社区" align="center" prop="communityName" min-width="10%"></el-table-column>
                <el-table-column label="开放式工位" align="center" prop="spaceNum" min-width="10%"></el-table-column>
                <el-table-column label="办公室" align="center" prop="officeNum" min-width="15%"></el-table-column>
                <el-table-column label="场地" align="center" prop="roadNum" min-width="15%"></el-table-column>
                <el-table-column label="操作" align="center" min-width="25%">
                  <template slot-scope="scope">
                    <!-- <el-button size="mini" type="text" @click="getHouseList(scope.row.id,2);">查看</el-button> -->
                    <el-button size="mini" type="text" @click="getHouseList(scope.row.id,1)">编辑</el-button>
                    <!-- <el-button size="mini">下架</el-button> -->
                    <!-- <el-button size="mini">删除</el-button> -->
                    <!-- <el-button size="mini">推荐</el-button> -->
                  </template>
                </el-table-column>
              </el-table>
            </div>
            <div class="housing-properties-page">
              <el-pagination
                @size-change="(val) => {communityQuery.size=val;getReleaseCommunity()}"
                @current-change="(val) => {communityQuery.page=val;getReleaseCommunity()}"
                background
                :page-sizes="[10, 20, 30, 40]"
                :page-size="communityQuery.size"
                :current-page.sync="communityQuery.page"
                layout="total, sizes, prev, pager, next"
                :total="communityTotal"
              ></el-pagination>
            </div>
          </div>
        </div>
      </div>
    </div>
    <!--创建房源-->
    <div class="housing-properties-add" v-if="housingpropertiesadd">
      <div class="housing-properties-add-title">{{isCreate==0?'创建':'更新'}}房源</div>
      <div class="housing-properties-form">
        <el-form ref="form" :model="houseForm" :label-width="labelWidth">
          <div class="housing-properties-flex">
            <el-form-item label="楼盘">
              <!-- <el-input v-model="form.input1"></el-input> -->
              <el-autocomplete
                style="min-width:160px;"
                v-model="buildingName"
                :fetch-suggestions="getBuilding"
                placeholder="请输入楼盘名称"
                @select="handleSelect"
                v-if="userInfo.companyType != 1"
                :disabled="isCreate == 1"
              ></el-autocomplete>
              <el-input
                style="min-width:185px;"
                v-if="userInfo.companyType == 1"
                v-model="buildingName"
                disabled
              ></el-input>
            </el-form-item>
            <el-form-item label-width="40px" label="楼号" v-if="userInfo && isFlag == 0 ">
              <el-input
                style="min-width:160px;"
                v-model="houseForm.buildingNo"
                placeholder="请输入楼号"
                @blur="changeHouseTitle()"
                :disabled="isCreate == 2"
              ></el-input>
            </el-form-item>
            <el-form-item label-width="40px" label="楼层" v-if="userInfo && isFlag == 0 ">
              <el-input
                style="min-width:160px;"
                v-model="houseForm.floorNo"
                placeholder="请输入楼层"
                @blur="changeHouseTitle()"
                :disabled="isCreate == 2"
              ></el-input>
            </el-form-item>
            <el-form-item
              label-width="40px"
              label="房号"
              v-if="userInfo && userInfo.conpanyType!=1 && userInfo.companyType != 3 && isFlag == 0"
            >
              <el-input
                style="min-width:160px;"
                v-model="houseForm.roomNo"
                placeholder="请输入房号"
                @blur="changeHouseTitle()"
                :disabled="isCreate == 2"
              ></el-input>
            </el-form-item>
            <el-form-item
              label="楼号-楼层-房号"
              v-if="userInfo && userInfo.companyType!='3' && isFlag == 1"
              label-width="110px"
            >
              <el-cascader
                style="min-width:160px;"
                :options="houseInfo"
                v-model="houseOptions"
                @change="handleChange"
                :disabled="isCreate == 2"
              ></el-cascader>
            </el-form-item>
            <el-form-item
              label="楼号-楼层"
              v-if="userInfo && userInfo.companyType=='3' && isFlag == 1"
              label-width="110px"
            >
              <el-cascader
                style="min-width:160px;"
                :options="houseInfo"
                v-model="houseOptions"
                @change="handleChange"
                :disabled="isCreate == 2"
              ></el-cascader>
            </el-form-item>
            <!-- <el-form-item label="楼号" v-if="userInfo.companyType!='0'" label-width="110px">
              <el-cascader
                style="min-width:160px;"
                :options="houseInfo"
                v-model="houseOptions"
                @change="handleChange"
                placeholder="请选择楼号"
                :disabled="isCreate == 2"
              ></el-cascader>
            </el-form-item>-->
            <!-- <el-form-item label="楼层-房号" v-if="userInfo.companyType!=0">
              <el-input
                style="min-width:160px;"
                v-model="floorRoom"
                placeholder="输入格式为 : 楼层-房号"
                @blur="judgeBuildRoom"
                :disabled="isCreate == 2"
              ></el-input>
            </el-form-item>-->
          </div>
          <div class="housing-properties-flex">
            <el-form-item label="面积">
              <el-input
                style="width:185px;min-width:160px;"
                v-model="houseForm.area"
                placeholder="请输入房源面积"
                @keydown="inputNumber"
                @blur="judgeArea(houseForm.area)"
                :disabled="isCreate == 2"
              ></el-input>
              <div class="housing-properties-text">m²</div>
            </el-form-item>
          </div>
          <div class="housing-properties-flex">
            <el-form-item label="可容纳工位">
              <!-- <input :disabled="true" v-model="minStation" type="text" name="" class="space-seat"> -->
              <el-input v-model="minStation"></el-input>
              <div class="housing-properties-text">至</div>
              <!-- <input :disabled="true" v-model="minStation" type="text" name="" class="space-seat"> -->
              <el-input v-model="maxStation"></el-input>
              <div class="housing-properties-text">个</div>
            </el-form-item>
          </div>
          <div class="housing-properties-flex">
            <el-form-item label="价格">
              <el-input
                v-model="houseForm.price"
                style="width:185px;min-width:160px;"
                placeholder="请输入价格"
                :disabled="isCreate == 2"
              ></el-input>
              <div class="housing-properties-text">元/m²·天</div>
            </el-form-item>
          </div>
          <div class="housing-properties-flex">
            <el-form-item label="最短租期">
              <el-input
                style="width:185px;min-width:160px;"
                v-model="houseForm.minTenancy"
                placeholder="12"
                :disabled="isCreate == 2"
              ></el-input>
              <div class="housing-properties-text">月</div>
            </el-form-item>
          </div>
          <div class="housing-properties-flex" v-if="userInfo && userInfo.companyType==0">
            <el-form-item label="委托方式">
              <el-radio-group v-model="houseForm.entrust" style="padding-top: 14px">
                <el-radio label="1">未委托</el-radio>
                <el-radio label="2">管家服务</el-radio>
                <el-radio label="3">一站式</el-radio>
                <el-radio label="4">直租发布</el-radio>
              </el-radio-group>
            </el-form-item>
          </div>
          <div
            class="housing-properties-flex"
            v-if="houseForm.entrust == 2 || houseForm.entrust == 4"
          >
            <el-form-item label="电话">
              <el-input
                style="width:185px;min-width:160px;"
                v-model="houseForm.phone"
                placeholder="请输入正确的电话号码"
                :disabled="isCreate == 2"
              ></el-input>
            </el-form-item>
          </div>
          <div class="housing-properties-flex" v-if="houseForm.entrust == 4">
            <el-form-item label="上架期限">
              <el-select v-model="houseForm.limitTime" placeholder="请选择上架期限">
                <el-option
                  v-for="item in limittimes"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </div>
          <!-- <div class="housing-properties-flex" v-if="userInfo && userInfo.companyType=='0'">
            <el-form-item label="个人业主">
              <el-radio-group v-model="houseForm.individualFlag" style="padding-top: 14px">
                <el-radio label="1">是</el-radio>
                <el-radio label="0">否</el-radio>
              </el-radio-group>
            </el-form-item>
          </div>-->
          <div class="housing-properties-flex">
            <el-form-item label="可否注册">
              <el-radio-group v-model="houseForm.registerFlag" style="padding-top: 14px">
                <el-radio label="1">是</el-radio>
                <el-radio label="2">否</el-radio>
              </el-radio-group>
            </el-form-item>
          </div>
          <div class="housing-properties-flex">
            <el-form-item label="朝向">
              <el-checkbox-group v-model="checkList">
                <el-checkbox label="0">东</el-checkbox>
                <el-checkbox label="1">南</el-checkbox>
                <el-checkbox label="2">西</el-checkbox>
                <el-checkbox label="3">北</el-checkbox>
              </el-checkbox-group>
            </el-form-item>
          </div>
          <div class="housing-properties-flex">
            <el-form-item label="装修状况">
              <el-radio-group v-model="houseForm.fitmentStatus" style="padding-top: 14px">
                <el-radio label="1">毛坯</el-radio>
                <el-radio label="2">标配简装</el-radio>
                <el-radio label="3">遗留装修</el-radio>
                <el-radio label="4">拎包入住</el-radio>
              </el-radio-group>
            </el-form-item>
          </div>
          <div class="housing-properties-flex">
            <el-form-item label="标题">
              <el-input
                v-model="houseTitle"
                style="width: 550px;"
                placeholder="请输入房源标题"
                :disabled="isCreate == 2"
              ></el-input>
            </el-form-item>
          </div>
          <div class="housing-properties-flex">
            <!-- <el-form-item label="楼层">
              <el-input v-model="form.input5"></el-input>
            </el-form-item>-->
          </div>

          <div class="housing-properties-flex">
            <el-form-item label="付费方式">
              <div class="housing-properties-text">押</div>
              <el-input v-model="houseForm.deposit" placeholder="1" :disabled="isCreate == 2"></el-input>
              <div class="housing-properties-text">付</div>
              <el-input v-model="houseForm.payment" placeholder="3" :disabled="isCreate == 2"></el-input>
            </el-form-item>
          </div>
          <div class="housing-properties-flex">
            <el-form-item label="隔断办公间">
              <el-input v-model="houseForm.chatRooms" placeholder="请输入数量" :disabled="isCreate == 2"></el-input>
              <div class="housing-properties-text">间</div>
            </el-form-item>
          </div>
          <div class="housing-properties-flex">
            <el-form-item label="房屋荐语">
              <el-input
                type="textarea"
                v-model="houseForm.introduce"
                placeholder="此表单前20字会显示在缩略图位置，请简要填写"
                style="width: 550px; height: 100px;"
                :disabled="isCreate == 2"
              ></el-input>
            </el-form-item>
          </div>
          <div class="housing-properties-add-title" style="margin-bottom:20px;">照片</div>

          <!-- <el-dialog :visible.sync="dialogVisible" size="tiny">
            <img width="100%" v-for="item in dialogImageUrl" :key="item.fileId" :src="item.url" alt>
          </el-dialog>-->
          <div class="housing-properties-footer">
            <div
              class="housing-properties-img"
              v-for="(item,index) in houseForm.imgList"
              :key="item"
            >
              <div class="house-delete" @click="deleteUpload('house',index)">×</div>
              <img :src="item?`${locationUrl}${item}`:imgDefault">
            </div>
            <el-upload
              action="vartualUrl"
              :show-file-list="false"
              list-type="picture-card"
              :on-success="uploadSuccess"
              :on-error="uploadError"
              :on-preview="handlePictureCardPreview"
              :on-remove="handleRemove"
              :http-request="importImg"
              style="float:left;padding:15px;"
              multiple
            >
              <i class="el-icon-plus"></i>
            </el-upload>
          </div>
        </el-form>
        <div class="housing-properties-bt">
          <el-button
            v-if="isCreate == 0 || isIndex"
            type="primary"
            style="padding: 10px 40px; margin: 0 20px;"
            @click="submitData('1','1')"
          >提交</el-button>
          <el-button
            v-if="isCreate == 1"
            type="primary"
            style="padding: 10px 40px; margin: 0 40px;"
            @click="updateBuiHouse('1')"
          >提交</el-button>
          <el-button
            type="primary"
            style="padding: 10px 20px; margin: 0 40px;"
            @click="submitData('1','0')"
            v-show="isCreate == 0 || isIndex"
          >保存为草稿</el-button>
          <el-button
            type="primary"
            style="padding: 10px 20px; margin: 0 40px;"
            @click="updateBuiHouse('0')"
            v-show="isCreate == 1"
          >保存为草稿</el-button>
          <!-- <el-button
            type="primary"
            style="padding: 14px 50px; margin: 0 40px;"
            @click="propertiesclose"
          >提交</el-button>-->
          <el-button style="padding: 10px 40px; margin: 0 20px;" @click="propertiesclose">返回</el-button>
        </div>
      </div>
    </div>
    <!--创建联合办公-->
    <div class="housing-union-add" v-if="housingunionadd">
      <div class="housing-union-add-title">创建联合办公</div>
      <div class="housing-properties-form">
        <el-form ref="form" :model="form" label-width="100px">
          <div class="housing-properties-flex">
            <el-form-item label="品牌">
              <el-autocomplete
                style="min-width:220px;"
                v-model="brandName"
                :fetch-suggestions="getBrandList"
                placeholder="请输入内容"
                @select="brandSelect"
                :disabled="isSeat == 1 || isSeat == 2"
              ></el-autocomplete>
            </el-form-item>
            <el-form-item label="社区" style="margin-left:80px;">
              <el-autocomplete
                style="min-width:220px;"
                v-model="communityName"
                :fetch-suggestions="getCommunityList"
                placeholder="请输入内容"
                @select="communitySelect"
                :disabled="isSeat == 1 || isSeat == 2"
              ></el-autocomplete>
            </el-form-item>
          </div>
        </el-form>
      </div>
      <div class="housing-union-add-title">开放式工位</div>
      <div class="housing-properties-form">
        <el-form ref="form" :model="communityForm" label-width="100px">
          <div class="housing-properties-flex">
            <el-form-item label="固定工位数量">
              <el-input v-model="fixSeat.num" :disabled="isSeat == 2"></el-input>
              <div class="housing-properties-text">个</div>
            </el-form-item>
            <el-form-item label="价格">
              <el-input v-model="fixSeat.price" :disabled="isSeat == 2"></el-input>
              <div class="housing-properties-text">元/月</div>
            </el-form-item>
          </div>
          <div class="housing-properties-flex">
            <el-form-item label="照片">
              <div class="seat-upload" v-if="fixSeat.imgUrl!==''&&fixSeat.imgUrl!==undefined">
                <!-- <div class="seat-list" v-for="(item,index) in fixSeat.imgList" :key="index"> -->
                <div class="upload-delete" @click="deleteUpload('fixed')">×</div>
                <img
                  :src="fixSeat.imgUrl?fixSeat.imgUrl:imgDefault"
                  alt
                  style="width:216px;height:144px;"
                >
                <!-- </div> -->
              </div>
              <el-upload
                :show-file-list="false"
                action="vartualUrl"
                list-type="picture-card"
                :on-preview="handlePictureCardPreview"
                :http-request="fixedUpload"
              >
                <i class="el-icon-plus"></i>
              </el-upload>
              <el-dialog :visible.sync="dialogVisible" size="tiny">
                <img
                  width="100%"
                  v-for="item in fixedImgList"
                  :key="item.fileId"
                  :src="item.url"
                  alt
                >
              </el-dialog>
            </el-form-item>
          </div>
          <div class="housing-properties-flex">
            <el-form-item label="移动工位数量">
              <el-input v-model="openSeat.num" :disabled="isSeat == 2"></el-input>
              <div class="housing-properties-text">个</div>
            </el-form-item>
            <el-form-item label="价格">
              <el-input v-model="openSeat.price" :disabled="isSeat == 2"></el-input>
              <div class="housing-properties-text">元/月</div>
            </el-form-item>
          </div>
          <div class="housing-properties-flex">
            <el-form-item label="照片">
              <div class="seat-upload" v-if="openSeat.imgUrl!==''&&openSeat.imgUrl!==undefined">
                <!-- <div class="seat-list" v-for="(item,index) in openSeat.imgList" :key="index"> -->
                <div class="upload-delete" @click="deleteUpload('open')">×</div>
                <img
                  :src="openSeat.imgUrl?openSeat.imgUrl:imgDefault"
                  alt
                  style="width:216px;height:144px;"
                >
                <!-- </div> -->
              </div>
              <el-upload
                :show-file-list="false"
                action="vartualUrl"
                list-type="picture-card"
                :on-preview="handlePictureCardPreview"
                :http-request="openUpload"
              >
                <i class="el-icon-plus"></i>
              </el-upload>
              <el-dialog :visible.sync="dialogVisible" size="tiny">
                <img
                  width="100%"
                  v-for="item in openImgList"
                  :key="item.fileId"
                  :src="item.url"
                  alt
                >
              </el-dialog>
            </el-form-item>
          </div>
        </el-form>
      </div>
      <div class="housing-union-add-title">
        办公室
        <el-button
          type="primary"
          size="mini"
          style="margin-left:25px;"
          @click="officedialog = true;officeUrl='';"
          v-show="isSeat!=2"
        >添加</el-button>
      </div>
      <div class="housing-union-add-center">
        <div
          class="housing-union-add-list"
          v-for="(item,index) in communityForm.houseOffice"
          :key="index"
        >
          <div class="housing-union-add-list-img">
            <img :src="item.imgUrl?item.imgUrl:imgDefault">
          </div>
          <div class="housing-union-add-list-title">
            {{item.capacity}}人办公室
            <span>数量：{{item.num}}间</span>
          </div>
          <div class="housing-union-add-list-bt">
            <div class="housing-union-add-list-bt-name">
              价格
              <span>{{item.price}}</span>人/月
            </div>
            <!--<div class="housing-union-add-list-bt-img"><img src="../assets/images/icon_add.png"></div>-->
            <div class="housing-union-add-list-bt-img" @click="delOfficeRoad(item.id,1,index)">
              <img src="../assets/images/icon_delete.png">
            </div>
          </div>
        </div>
      </div>
      <div class="housing-union-add-title">
        路演场地
        <el-button
          type="primary"
          size="mini"
          style="margin-left:25px;"
          @click="roaddialog = true;roadUrl='';"
          v-show="isSeat!=2"
        >添加</el-button>
      </div>
      <div class="housing-union-add-center">
        <div
          class="housing-union-add-list"
          v-for="(item,index) in communityForm.houseRoad"
          :key="index"
        >
          <div class="housing-union-add-list-img">
            <img :src="item.imgUrl?item.imgUrl:imgDefault">
          </div>
          <!-- <div class="housing-union-add-list-title">
            容纳人数{{item.capacity}}
            <span>数量：间</span>
          </div>-->
          <div
            class="housing-union-add-list-cont"
          >面积：{{item.area}}m²&nbsp;&nbsp;&nbsp;&nbsp;净高：{{item.clearHight}}m&nbsp;&nbsp;&nbsp;&nbsp;容纳人数：{{item.capacity}}</div>
          <div class="housing-union-add-list-bt">
            <div class="housing-union-add-list-bt-name">
              价格
              <span>{{item.price}}</span>元/半天
            </div>
            <!--<div class="housing-union-add-list-bt-img"><img src="../assets/images/icon_add.png"></div>-->
            <div class="housing-union-add-list-bt-img" @click="delOfficeRoad(item.id,3,index)">
              <img src="../assets/images/icon_delete.png">
            </div>
          </div>
        </div>
      </div>
      <div class="housing-properties-bt">
        <el-button
          v-if="isSeat == 0"
          type="primary"
          style="padding: 14px 50px; margin: 0 40px;"
          @click="createCommunity"
        >提交</el-button>
        <el-button
          v-if="isSeat == 1"
          type="primary"
          style="padding: 14px 50px; margin: 0 40px;"
          @click="updateHouseList()"
        >提交</el-button>
        <el-button style="padding: 14px 50px; margin: 0 40px;" @click="housingunionclose">返回</el-button>
      </div>
      <!--添加办公室弹窗-->
      <div class="housing-union-office-dialog">
        <el-dialog
          title="添加办公室"
          :visible.sync="officedialog"
          :close-on-click-modal="false"
          :lock-scroll="false"
          width="548px"
          height="650px"
        >
          <el-form ref="form" :model="office" label-width="100px">
            <div class="housing-properties-flex">
              <el-form-item label="办公室人数">
                <el-input v-model="office.capacity"></el-input>
              </el-form-item>
            </div>
            <div class="housing-properties-flex">
              <el-form-item label="数量">
                <el-input v-model="office.num"></el-input>
                <div class="housing-properties-text">间</div>
              </el-form-item>
            </div>
            <div class="housing-properties-flex">
              <el-form-item label="价格">
                <el-input v-model="office.price"></el-input>
                <div class="housing-properties-text">人／月</div>
              </el-form-item>
            </div>
            <el-form-item label="照片">
              <div class="upload-list" v-show="officeUrl !=='' && officeUrl !== undefined">
                <img :src="officeUrl?officeUrl:imgDefault" alt>
              </div>
              <el-upload
                action="vartualUrl"
                :show-file-list="false"
                list-type="picture-card"
                :on-preview="handlePictureCardPreview"
                :http-request="officeUpload"
              >
                <i class="el-icon-plus"></i>
              </el-upload>
              <el-dialog :visible.sync="dialogVisible" size="tiny">
                <!-- <img
                  width="100%"
                  alt
                >-->
              </el-dialog>
            </el-form-item>
          </el-form>
          <div slot="footer">
            <el-button type="primary" @click="addOffice()" class="apply-submit">确定</el-button>
            <el-button @click="officedialog = false;officeUrl=''" class="apply-colse">返 回</el-button>
          </div>
        </el-dialog>
      </div>
      <!--添加路演场地弹窗-->
      <div class="housing-union-road-dialog">
        <el-dialog
          title="添加路演场地"
          :visible.sync="roaddialog"
          :close-on-click-modal="false"
          :lock-scroll="false"
          width="548px"
          height="650px"
        >
          <el-form ref="form" :model="road" label-width="100px">
            <div class="housing-properties-flex">
              <el-form-item label="路演场地标题">
                <el-input v-model="road.title"></el-input>
                <div class="housing-properties-text"></div>
              </el-form-item>
            </div>
            <!-- <div class="housing-properties-flex">
              <el-form-item label="数量">
                <el-input v-model="road.input23"></el-input>
                <div class="housing-properties-text">间</div>
              </el-form-item>
            </div>-->
            <div class="housing-properties-flex">
              <el-form-item label="面积">
                <el-input v-model="road.area"></el-input>
                <div class="housing-properties-text">平米</div>
              </el-form-item>
            </div>
            <div class="housing-properties-flex">
              <el-form-item label="净高">
                <el-input v-model="road.clearHight"></el-input>
                <div class="housing-properties-text">米</div>
              </el-form-item>
            </div>
            <div class="housing-properties-flex">
              <el-form-item label="容纳人数">
                <el-input v-model="road.capacity"></el-input>
                <div class="housing-properties-text">人</div>
              </el-form-item>
            </div>
            <div class="housing-properties-flex">
              <el-form-item label="价格">
                <el-input v-model="road.price"></el-input>
                <div class="housing-properties-text">元／半天</div>
              </el-form-item>
            </div>
            <el-form-item label="照片">
              <div class="upload-list" v-show="roadUrl !=='' && roadUrl !== undefined">
                <img :src="roadUrl?roadUrl:imgDefault" alt>
              </div>
              <el-upload
                action="vartualUrl"
                :show-file-list="false"
                list-type="picture-card"
                :on-preview="handlePictureCardPreview"
                :http-request="roadUpload"
                v-show="roadUrl =='' || roadUrl == undefined"
              >
                <i class="el-icon-plus"></i>
              </el-upload>
              <el-dialog :visible.sync="dialogVisible" size="tiny">
                <!-- <img
                  width="100%"
                  alt
                >-->
              </el-dialog>
            </el-form-item>
          </el-form>
          <div slot="footer">
            <el-button type="primary" @click="addRoad" class="apply-submit">确定</el-button>
            <el-button @click="roaddialog = false" class="apply-colse">返 回</el-button>
          </div>
        </el-dialog>
      </div>
    </div>
  </div>
</template>

<script>
import * as houseAPI from "@/api/house";
import * as publicAPI from "@/api/public";
import * as othersAPI from "@/api/others";
import * as vauta from "@/axios/validate";

export default {
  name: "housing",
  data() {
    return {
      isIndex: false,
      userInfo: {},
      //获取社区参数
      communityQuery: {
        keyword: "",
        page: 1,
        size: 10
      },
      // 联合办公查询
      communityData: [], // 联合办公列表
      communityTotal: 12, //社区总数

      //获取楼盘房源参数
      buildingQuery: {
        keyword: "",
        houseStatus: "1",
        page: 1,
        size: 10,
        time: "1"
      },
      builHouseList: [], //楼盘房源
      buildingTotal: 0, //楼盘房源总数
      statusNum: {
        draftNum: "0",
        soldoutNum: "0",
        releaseNum: "0"
      }, //状态数

      // 上传图片
      vartualUrl: "http://test.com", //虚拟上传地址
      dialogVisible: false,
      dialogImageUrl: [], //房源图片列表
      fixedImgList: [], //固定工位图片列表
      openImgList: [], //开放工位图片列表

      // 创建楼盘房源
      houseForm: { roomNo:'', area: "", imgList: [] }, //参数
      houseTitle: "", //房源标题
      buildingList: [{ value: "暂无数据", id: "00" }], // 楼盘列表
      buildingName: "", //楼盘名称
      buildingId: "", //楼盘Id
      houseInfo: [], // 房号列表
      houseOptions: [], // 房号信息
      isCreate: 0, //是否为创建房源 0为创建 1为更新 2为查看
      floorRoom: "", //楼层房号
      developerBuilding: "", //开发商楼盘默认
      buildingImg: "", //楼盘图片暂存
      minStation: "", //最小容纳工位
      maxStation: "", //最大容纳工位
      isFlag: 0, //是否为全信息楼盘
      checkList: [], //朝向数组
      labelWidth: "100px",
      limittimes: [
        //上架期限
        {
          value: "7",
          label: "7 天"
        },
        {
          value: "14",
          label: "14 天"
        },
        {
          value: "21",
          label: "21 天"
        },
        {
          value: "28",
          label: "28 天"
        }
      ],

      // 创建联合办公房源
      communityForm: { houseSpace: [], houseOffice: [], houseRoad: [] }, //参数
      brandName: "", //品牌名称
      brandId: "", //品牌Id
      brandList: [], //品牌列表
      communityName: "", //社区名称
      communityId: "", //社区Id
      communityList: [], //社区列表
      isSeat: 0, //是否为创建房源 0为创建 1为更新 2为查看
      fixSeat: { num: "", price: "", imgUrl: "" },
      openSeat: { num: "", price: "", imgUrl: "" },
      office: {}, //办公室
      road: {}, //路演场地
      housing: true,
      housingpropertiesadd: false,
      housingunionadd: false,
      officedialog: false, // 办公室添加
      roaddialog: false,
      officeUrl: "", //办公室展示上传图片
      roadUrl: "", //路演场地展示上传图片
      officeList: [], //办公室创建提交
      roadList: [], //路演场地创建提交
      delOffice: [], //删除办公室列表
      delRoad: [], //删除路演场地Id列表
      sxradio: "1",
      sxdata: "",
      surplusNum: 0,
      timeShow: false,
      countUserHouseArr: {},
      input: "",
      cur: 0,
      son: 1,
      con: 0,
      value: "",
      radio: "1",
      form: {},
      imgLoading: {} //图片上传loading
    };
  },
  created() {
    if (localStorage.userInfo) {
      this.userInfo = JSON.parse(localStorage.userInfo);
    }
    if (this.$route.query.index == "index") {
      this.addproperties();
      this.isIndex = true;
    } else {
      this.isIndex = false;
    }
    this.getReleaseHouse(1);

    if (this.userInfo && this.userInfo.companyType == 3) {
      this.surplus();
    }
    window.addEventListener("scroll", this.handleScroll, true); // 监听（绑定）滚轮滚动事件
  },
  methods: {
    //鼠标滚动事件
    handleScroll() {
      // var blurfn = document.getElementsByClassName('el-input__inner')[0];
      // blurfn.blur()
    },
    // 获取发布中联合办公房源
    getReleaseCommunity(houseStatus) {
      if (this.userInfo.companyType == -1) {
        this.$alert("您还未进行公司认证", "温馨提示", {
          confirmButtonText: "去认证",
          callback: action => {
            this.$router.push({
              path: "/Home/Authentication"
            });
          }
        });
        return;
      }
      this.cur = 1;
      houseAPI
        .getReleaseCommunity(this.communityQuery)
        .then(response => {
          this.communityData = response.data.list;
          this.communityTotal = response.data.total;
        })
        .catch(err => {
          // this.$message.error("查询失败");
          console.log("获取发布中联合办公房源====>", err);
        });
    },
    // 获取发布中的楼盘房源
    getReleaseHouse(houseStatus) {
      if (houseStatus < 3) {
        this.son = houseStatus;
      }
      this.buildingQuery.houseStatus = this.son;
      houseAPI
        .getReleaseHouse(this.buildingQuery)
        .then(response => {
          // response.data.list.forEach((element, index) => {
          //   if (response.data.list[index + 1]) {
          //     this.builHouseList[index] = {
          //       name1: response.data.list[index+index]["houseTitle"],
          //       name2: response.data.list[index + 1]["houseTitle"]
          //     };
          //   }
          // });
          this.builHouseList = response.data.list;

          // this.buildingTotal =
          //   response.data.releaseNum +
          //   response.data.draftNum +
          //   response.data.soldoutNum;
          switch (this.son) {
            case 0:
              this.buildingTotal = response.data.draftNum;
              break;
            case 1:
              this.buildingTotal = response.data.releaseNum;
              break;
            case 2:
              this.buildingTotal = response.data.soldoutNum;
              break;
          }
          this.statusNum = {
            draftNum: response.data.draftNum,
            releaseNum: response.data.releaseNum,
            soldoutNum: response.data.soldoutNum
          };
        })
        .catch(err => {
          // this.$message.error("查询失败");
          console.log("获取发布中联合办公房源====>", err);
        });
    },
    areaSort(row) {
      switch (row.prop) {
        case "area":
          this.buildingQuery.time = null;
          this.buildingQuery.prices = null;
          if (row.order == "ascending") {
            this.buildingQuery.area = "0";
          } else if (row.order == "descending") {
            this.buildingQuery.area = "1";
          } else {
            this.buildingQuery.area = null;
          }
          break;
        case "price":
          this.buildingQuery.time = null;
          this.buildingQuery.area = null;
          if (row.order == "ascending") {
            this.buildingQuery.prices = "0";
          } else if (row.order == "descending") {
            this.buildingQuery.prices = "1";
          } else {
            this.buildingQuery.prices = null;
          }
          break;
        case "publishTime":
          this.buildingQuery.area = null;
          this.buildingQuery.prices = null;
          if (row.order == "ascending") {
            this.buildingQuery.time = "0";
          } else if (row.order == "descending") {
            this.buildingQuery.time = "1";
          } else {
            this.buildingQuery.time = null;
          }
          break;
      }
      this.getReleaseHouse();
    },
    // 获取楼盘列表
    getBuilding(keyword, cb) {
      this.buildingList = [];
      let msg = keyword;
      if (keyword == "" || keyword == undefined) {
        msg = "";
      }
      houseAPI
        .getBuiListByKeyword({ keyword: msg })
        .then(response => {
          if (response.data != undefined) {
            response.data.forEach((element, ind) => {
              if (!keyword && ind < 51) {
                this.buildingList.push({
                  id: element.id,
                  value: element.buildingName,
                  buildingFlag: element.buildingFlag
                });
              } else if (keyword) {
                this.buildingList.push({
                  id: element.id,
                  value: element.buildingName,
                  buildingFlag: element.buildingFlag
                });
              }
            });
          } else {
            this.$message({
              type: "warning",
              message: "打字太快啦"
            });
          }
          cb(this.buildingList);
        })
        .catch(err => {
          console.log("获取楼盘列表====>", err);
        });
    },
    // 楼盘选择
    handleSelect(item) {
      // this.buildingId = item.id;
      if (item.buildingFlag == 0) {
        this.isFlag = 0;
        this.labelWidth = "85px";
      } else if (item.buildingFlag == 1) {
        this.isFlag = 1;
        this.labelWidth = "100px";
        this.getBuildingFloorInfo(item.id);
      } else {
        this.isFlag = 2;
      }
      this.houseForm = {
        imgList: [],
        area: "",
        roomNo:''
      };
      // this.houseForm.buildingNo = "";
      // this.houseForm.floorNo = "";
      this.houseForm.buildingId = item.id;
      this.changeHouseTitle();
    },
    // 楼号选择
    handleChange(item) {
      this.houseForm.buildingNo = this.houseOptions[0];
      if (this.houseOptions[1]) {
        // const index1 = this.houseOptions[1].indexOf("&");
        // this.houseForm.floorNo = this.houseOptions[1].substring(0, index1);
        this.houseForm.floorNo = this.houseOptions[1];
      }
      if (this.houseOptions[2]) {
        // const index2 = this.houseOptions[2].indexOf("&");
        // this.houseForm.roomNo = this.houseOptions[2].substring(0, index2);
        this.houseForm.roomNo = this.houseOptions[2];
      }
        this.floorRoom = `${this.houseOptions[0]}-${this.houseOptions[1]}-${this.houseOptions[2]}`
      this.changeHouseTitle();
    },
    // 模糊匹配楼号
    getBuildingFloorInfo(id) {
      this.houseInfo = [];
      houseAPI
        .getBuildingFloorInfo({ buildingId: id })
        .then(response => {
          if (response.data.length <= 0 && this.isFlag == 1) {
            this.isFlag = 2;
            this.houseForm.buildingNo = "";
            this.houseForm.floorNo = "";
            this.houseForm.roomNo = "";
            this.changeHouseTitle();

            this.$message.warning("当前楼盘下无楼号等信息");
          }
          this.houseInfo = response.data;
          this.houseInfo.forEach((item1, ind1) => {
            item1.label = item1.buiNo;
            item1.value = item1.buiNo;
            // if (this.userInfo.companyType != 3){
            item1.children = item1.floorList;
            item1.floorList.forEach((item2, ind2) => {
              // let s = Math.random();
              // item2.value = item2.floor + `&${s}`;
              item2.label = parseInt(item2.floor);
              item2.value = item2.floor;
              if (this.userInfo.companyType != 3) {
                item2.children = [];
                item2.roomNoList.forEach((item3, ind3) => {
                  let s = Math.random();
                  item2.children.push({
                    // value: item3 + `&${s}`,
                    value: item3,
                    label: item3
                  });
                });
              }
            });

            // }
            // if (this.userInfo.companyType != 0) {
            //   item1.children = item1.floorList;
            //   item1.floorList.forEach((item2, ind2) => {
            //     let s = Math.random();
            //     item2.label = item2.floor;
            //     item2.value = item2.floor + `&${s}`;
            //     if (this.userInfo.companyType == 1) {
            //       item2.children = [];
            //       item2.roomNoList.forEach((item3, ind3) => {
            //         let s = Math.random();
            //         item2.children.push({
            //           value: item3 + `&${s}`,
            //           label: item3
            //         });
            //       });
            //     }
            //   });
            // }
          });
        })
        .catch(err => {
          console.log("模糊匹配楼号====>", err);
        });
    },
    // 获取品牌
    getBrandList(keyword, cb) {
      let msg = keyword;
      if (keyword == "" || keyword == undefined) {
        msg = "22";
      }
      this.brandList = [];
      this.brandId = "";
      houseAPI
        .getBrandList({ keyword: msg })
        .then(response => {
          if (response.data != undefined) {
            response.data.list.forEach(element => {
              this.brandList.push({
                id: element.id,
                value: element.brandName
              });
            });
          } else {
            this.$message({
              type: "warning",
              message: "打字太快啦"
            });
          }
          cb(this.brandList);
        })
        .catch(err => {
          console.log("获取品牌====>", err);
        });
    },
    // 获取社区
    getCommunityList(keyword, cb) {
      this.communityList = [];
      houseAPI
        .getCommunityList({ keyword: keyword, brandId: this.brandId })
        .then(response => {
          if (response.data != undefined) {
            response.data.list.forEach(element => {
              if (element.hasHouseFlag == 0) {
                this.communityList.push({
                  id: element.id,
                  value: element.communityName
                });
              }
            });
          } else {
            this.$message({
              type: "warning",
              message: "打字太快啦"
            });
          }
          if (this.communityList.length <= 0) {
            this.$message.warning("品牌下无社区或均已创建房源");
          } else {
            cb(this.communityList);
          }
        })
        .catch(err => {
          console.log("模糊匹配社区===>", err);
        });
    },
    // 品牌选择
    brandSelect(item) {
      this.brandId = item.id;
      this.communityForm.brandId = item.id;
    },
    // 社区选择
    communitySelect(item) {
      this.communityId = item.id;
      this.communityForm.communityId = item.id;
    },
    // 添加办公室
    addOffice() {
      this.officeUrl = "";
      this.communityForm.houseOffice.push(this.office);
      // this.addCommunity(0);
      this.office = new Object();
      this.officedialog = false;
    },
    // 添加路演场地
    addRoad() {
      this.communityForm.houseRoad.push(this.road);
      // this.addCommunity(1);
      this.road = new Object();
      this.roaddialog = false;
    },
    // 删除办公室
    // deleteOffice(index) {
    //   this.communityForm.houseOffice.splice(index, 1);
    // },
    //删除路演场地
    // deleteRoad(index) {
    //   this.communityForm.houseRoad.splice(index, 1);
    // },
    // 删除楼盘房源
    delBuildingHouse(houseId) {
      this.$confirm("确定删除此房源?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(() => {
        houseAPI
          .delBuildingHouse({ houseId: houseId })
          .then(response => {
            this.$message.success(response.message);
            this.getReleaseHouse();
          })
          .catch(err => {
            console.log("删除楼盘房源====>", err);
          });
      });
    },
    // 删除社区房源
    delOfficeRoad(id, type, index) {
      this.$confirm(`确定删除此房源?`, "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(() => {
        if (type == 1) {
          this.communityForm.houseOffice.splice(index, 1);
          this.delOffice.push({ id: id, type: type });
        } else if (type == 3) {
          this.communityForm.houseRoad.splice(index, 1);
          this.delRoad.push({ id: id, type: type });
        }
      });
    },
    // 提交删除社区房源
    houseDelete(houseId, type) {
      // then(() => {
      houseAPI
        .houseDelete({ houseId: houseId, type: type })
        .then(response => {})
        .catch(err => {
          console.log("删除房源=======>", err);
        });
      // });
    },
    // 上下架楼盘房源
    fallBuiHouse(row, type, msg) {
      if (
        type == "1" &&
        this.statusNum.releaseNum >= 30 &&
        this.userInfo.companyType == 3
      ) {
        this.$message.warning("发布中房源数量已达上限！");
        return;
      }
      this.$confirm(`确定${msg}此房源?`, "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(() => {
        houseAPI
          .fallBuiHouse({ houseId: row.houseId, status: type })
          .then(response => {
            this.$message.success(response.message);
            this.getReleaseHouse();
          })
          .catch(err => {
            console.log("下架楼盘房源====>", err);
          });
      });
    },
    limitDelete(row) {
      let type = false;
      switch (this.userInfo.companyType) {
        case "-1":
          type = false;
          break;
        case "0":
          if (row.selfFlag == 1) {
            type = true;
          }
          break;
        case "1":
          if (this.userInfo.adminFlag == "1") {
            type = true;
          } else if (row.selfFlag == 1) {
            type = true;
          } else {
            type = false;
          }
          break;
        case "2":
          if (this.userInfo.adminFlag == "1") {
            type = true;
          } else if (row.selfFlag == 1) {
            type = true;
          } else {
            type = false;
          }
          break;
        case "3":
          if (row.selfFlag == 1) {
            type = true;
          }
          break;
      }
      return type;
    },
    limitType() {
      let type = false;
      switch (this.userInfo.companyType) {
        case "-1":
          type = false;
          break;
        case "0":
          type = false;
          break;
        case "1":
          if (this.userInfo.adminFlag == "1") {
            type = false;
          } else {
            type = false;
          }
          break;
        case "2":
          if (this.userInfo.adminFlag == "1") {
            type = true;
          } else {
            type = false;
          }
          break;
        case "3":
          type = true;
          break;
      }
      return type;
    },
    // 推荐楼盘房源
    recommendHouse(row, type, msg) {
      houseAPI.countRecommend().then(response => {
        if (
          this.userInfo &&
          this.userInfo.companyType == 2 &&
          response.data >= 4 &&
          type != 0
        ) {
          this.$message.warning("您可推荐房源数已达上限！");
          return;
        } else if (
          this.userInfo &&
          this.userInfo.companyType == 3 &&
          response.data >= 2 &&
          type != 0
        ) {
          this.$message.warning("您可推荐房源数已达上限！");
          return;
        } else {
          this.$confirm(`确定${msg}此房源?`, "提示", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning"
          }).then(() => {
            houseAPI
              .recommendHouse({ houseId: row.houseId, recommendFlag: type })
              .then(response => {
                this.$message.success(response.message);
                this.getReleaseHouse();
              })
              .catch(err => {
                console.log("推荐楼盘房源====>", err);
              });
          });
        }
      });
    },
    // 刷新房源
    refresh(row) {
      houseAPI.getRefreshNum().then(res => {
        if (this.surplusNum > 0) {
          houseAPI.refreshHouse({ houseId: row.houseId }).then(resopnse => {
            this.getReleaseHouse("1");
            this.$message.success(
              `刷新成功！剩余刷新次数：${this.surplusNum - 1}`
            );
            this.surplus();
          });
        } else {
          this.$message.warning("今日刷新次数已达上限！");
        }
      });
    },
    //获取剩余刷新次数
    surplus() {
      if (this.userInfo.companyType == "3") {
        houseAPI.getRefreshNum().then(res => {
          const count = 30 - res.data.num;
          this.surplusNum = count;
        });
      }
    },
    //执行时间
    sxChange() {
      if (this.sxradio == 2) {
        this.timeShow = true;
      } else {
        this.timeShow = false;
      }
    },
    // // 图片上传中的钩子
    // uploading() {
    //   console.log(0)

    // },
    // 图片上传失败钩子
    uploadError() {
      this.imgLoading.close();
    },
    // 图片上传成功的钩子
    uploadSuccess() {
      this.imgLoading.close();
    },
    // 图片上传的钩子
    handlePictureCardPreview(file) {
      this.dialogVisible = true;
    },
    // 自定义图片上传
    importImg(item) {
      this.uploadImg(item, "house", 720, 480, 1);
    },
    // 固定工位图片上传
    fixedUpload(item) {
      this.uploadImg(item, "fixed", 720, 480, 1);
    },
    // 移动工位图片上传
    openUpload(item) {
      this.uploadImg(item, "open", 720, 480, 1);
    },
    // 办公室房源图片上传
    officeUpload(item) {
      this.uploadImg(item, "office", 720, 480, 1);
    },
    // 路演场地图片上传
    roadUpload(item) {
      this.uploadImg(item, "road", 720, 480, 1);
    },
    // 图片上传
    uploadImg(item, type, width, height, water) {
      this.imgLoading = this.$loading({
        lock: true,
        text: "上传中，请稍后",
        spinner: "el-icon-loading",
        background: "rgba(0, 0, 0, 0.7)"
      });
      let fileList = item.file;
      const fileSize = fileList.size / 1024 / 1024;
      if (fileSize > 20) {
        this.$message.warning("上传图片大小不能超过 20MB!");
        return;
      }
      let formData = new FormData();
      formData.append("width", width);
      formData.append("height", height);
      formData.append("water", water);
      formData.append("file", fileList);
      let config = {
        headers: {
          "Content-Type": "multipart/form-data"
        }
      };
      publicAPI.uploadImage(formData).then(response => {
        setTimeout(() => {
          this.imgLoading.close();
        }, 400);
        switch (type) {
          case "house":
            this.dialogImageUrl.push({
              fileId: response.data.id,
              url: response.data.url
            });
            this.houseForm.imgList.push(response.data.id);
            this.buildingImg = response.data.id;
            break;
          case "fixed":
            this.fixedImgList.push({
              fileId: response.data.id,
              url: response.data.url
            });
            this.fixSeat.imgUrl = response.data.url;
            // this.fixSeat.imgList.push(response.data.id);
            this.fixSeat.imgId = response.data.id;
            break;
          case "open":
            this.openImgList.push({
              fileId: response.data.id,
              url: response.data.url
            });
            // this.openSeat.imgList.push(response.data.id);
            this.openSeat.imgUrl = response.data.url;
            this.openSeat.imgId = response.data.id;
            break;
          case "office":
            this.office.imgId = response.data.id;
            this.office.imgUrl = response.data.url;
            this.officeUrl = response.data.url;
            this.officeId = response.data.id;
            break;
          case "road":
            this.road.imgId = response.data.id;
            this.road.imgUrl = response.data.url;
            this.roadUrl = response.data.url;
            this.roadId = response.data.id;
            break;
        }
      });
    },
    deleteUpload(type, index) {
      switch (type) {
        case "house":
          this.houseForm.imgList.splice(index, 1);
          break;
        case "fixed":
          this.$set(this.fixSeat, "imgUrl", "");
          // this.fixSeat.imgList = [];
          break;
        case "open":
          this.$set(this.openSeat, "imgUrl", "");
          // this.openSeat.imgList = [];
          break;
        case "office":
          this.office.imgId = response.data.id;
          this.office.imgUrl = response.data.url;
          this.officeUrl = response.data.url;
          break;
        case "road":
          this.road.imgId = response.data.id;
          this.road.imgUrl = response.data.url;
          this.roadUrl = response.data.url;
          break;
      }
    },
    // 上传成功移除列表
    handleRemove(file, fileList) {
      this.houseForm.imgList.forEach((element, index) => {
        if ((element = this.buildingImg)) {
          this.houseForm.imgList.splice(index, 1);
        }
      });
    },
    // 获取开发商账户楼盘
    getDeveloperBuilding() {
      othersAPI.getDeveloperBuilding().then(response => {
        this.buildingName = response.data.buildingName;
        this.buildingId = response.data.buildingId;
        this.isFlag = response.data.buildingFlag;
        this.houseForm.buildingId = response.data.buildingId;
        this.getBuildingFloorInfo(response.data.buildingId);
      });
    },
    // 创建楼盘房源
    submitData(type, optType) {
      this.houseForm.optType = optType;
      this.houseForm.orientation = this.checkList.join(",");
      if (!this.houseForm.buildingId) {
        this.$message.warning("请选择楼盘！");
        return;
      }
      if (
        this.userInfo &&
        this.userInfo.companyType != "3" &&
        !this.houseForm.buildingNo &&
        this.isFlag == 0
      ) {
        this.$message.warning("请输入楼号！");
        return;
      }
      if (!this.houseForm.floorNo && this.isFlag == 0) {
        this.$message.warning("请输入楼层！");
        return;
      }
      if (
        this.userInfo &&
        this.userInfo.companyType != "3" &&
        !this.houseForm.floorNo &&
        this.isFlag == 1
      ) {
        this.$message.warning("请选择楼号-楼层-房号！");
        return;
      }
      if (!this.houseForm.area) {
        this.$message.warning("请输入面积");
        return;
      }
      if (
        this.houseForm.minTenancy == undefined ||
        this.houseForm.minTenancy == ""
      ) {
        this.houseForm.minTenancy = 12;
      }
      if (!this.houseForm.price) {
        this.$message.warning("请输入价格");
        return;
      }
      if (
        this.userInfo &&
        this.userInfo.companyType == 0 &&
        !this.houseForm.entrust
      ) {
        this.$message.warning("请选择委托方式！");
        return;
      }
      if (!this.houseForm.registerFlag) {
        this.$message.warning("请选择是否可注册公司！");
        return;
      }
      if (!this.houseForm.orientation) {
        this.$message.warning("请选择朝向！");
        return;
      }
      if (!this.houseForm.fitmentStatus) {
        this.$message.warning("请选择装修状况！");
        return;
      }
      if (!this.houseForm.deposit) {
        this.houseForm.deposit = "1";
      }
      if (!this.houseForm.payment) {
        this.houseForm.payment = "3";
      }
      // if (this.userInfo.companyType == 0) {
      //   if (!this.judgeBuildRoom()) {
      //     return;
      //   }
      // }
      if (!this.houseForm.chatRooms) {
        this.houseForm.chatRooms = 0;
      }
      let msg = "确定创建此房源?";
      if (this.userInfo.companyType == "3") {
        if (this.countUserHouseArr.allNum >= 100) {
          this.$message.warning("请先清除房源,再进行添加");
          return;
        } else if (this.countUserHouseArr.releaseNum >= 30) {
          msg =
            "当前创建房源有效期为30天，是否创建<br/>创建房源数超限,此房源将被自动添加到下架箱";
          this.houseForm.optType = "2";
        } else if (this.surplusNum <= 0) {
          msg = " 今日刷新/发布房源数已达上限，房源将保存至草稿箱";
          this.houseForm.optType = "0";
        } else {
          msg = "当前创建房源有效期为30天，是否创建";
        }
        this.houseForm.limitTime = "30";
        // this.houseForm.validateTime = vauta.getFifteen() + " 23:59:59";
      } else if (this.userInfo.companyType == "0") {
        if (this.houseForm.entrust != 4) {
          this.houseForm.limitTime = "9999";
        }
      } else {
        this.houseForm.limitTime = "9999";
      }
      this.$confirm(msg, "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        dangerouslyUseHTMLString: true,
        type: "warning"
      }).then(() => {
        if (this.userInfo.companyType != 0) {
          this.houseForm.individualFlag = 0;
        }
        this.houseForm.title = this.houseTitle;

        houseAPI
          .createBuild(this.houseForm)
          .then(response => {
            if (response.code == "200") {
              this.propertiesclose();
              this.$message.success("创建成功");
              this.isFlag = 2;
              this.checkList = [];
              this.getReleaseHouse();
              this.houseForm = { imgList: [], area: "" };
              this.houseOptions = [];
              this.buildingName = "";
              this.floorRoom = "";
            }
          })
          .catch(() => {
            this.$message.warning("创建失败，请检查信息是否填写正确！");
          });
      });
    },
    // 创建联合办公房源
    createCommunity() {
      this.communityForm.houseSpace = [];
      if (this.fixSeat.num) {
        this.fixSeat.type = "1";
        this.communityForm.houseSpace.push(this.fixSeat);
      }
      if (this.openSeat.num) {
        this.openSeat.type = "2";
        this.communityForm.houseSpace.push(this.openSeat);
      }
      this.communityForm.optType = "1";
      this.$confirm("确定创建此房源?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(() => {
          let query = {
            brandId: this.communityForm.brandId,
            communityId: this.communityForm.communityId,
            houseSpace: [],
            houseOffice: [],
            houseRoad: []
          };
          let houseOffice = [],
            houseRoad = [],
            houseSpace = [];
          houseSpace = this.communityForm.houseSpace;
          houseOffice = this.communityForm.houseOffice;
          houseRoad = this.communityForm.houseRoad;

          houseSpace.forEach((item, index) => {
            if (!item.id) {
              query.houseSpace.push(item);
            }
          });
          houseOffice.forEach((item, index) => {
            if (!item.id) {
              query.houseOffice.push(item);
            }
          });
          houseRoad.forEach((item, index) => {
            if (!item.id) {
              query.houseRoad.push(item);
            }
          });
          houseAPI
            .createCommunit(query)
            .then(response => {
              this.getReleaseCommunity();
              this.housingunionclose();
              this.fixSeat = { num: "", price: "", imgUrl: "" };
              this.openSeat = { num: "", price: "", imgUrl: "" };
              this.communityForm = {
                houseSpace: [],
                houseOffice: [],
                houseRoad: []
              };
              this.$message.success("创建成功");
              // this.$router.push({ path: "housing" });
            })
            .catch(err => {
              this.$message.warning("创建失败，请检查信息是否填写正确！");
              console.log("创建房源====>", err);
            });
        })
        .catch(err => {});
    },
    // 创建添加
    addCommunity(type) {
      if (
        this.communityForm.houseSpace[0] == undefined ||
        this.communityForm.houseSpace[0].id == undefined
      ) {
        if (this.fixSeat.num && this.fixSeat.price) {
          this.communityForm.houseSpace[0] = this.fixSeat;
        }
      }
      if (
        this.communityForm.houseSpace[1] == undefined ||
        this.communityForm.houseSpace[0].id == undefined
      ) {
        if (this.openSeat.num && this.openSeat.price) {
          this.communityForm.houseSpace[1] = this.openSeat;
        }
      }
      // }
      // this.communityForm.houseSpace = [];
      this.communityForm.optType = "1";
      let query = {
        brandId: this.communityForm.brandId,
        communityId: this.communityForm.communityId,
        houseOffice: [],
        houseRoad: [],
        houseSpace: []
      };
      let houseOffice = [],
        houseRoad = [],
        houseSpace = [];
      houseOffice = this.communityForm.houseOffice;
      houseRoad = this.communityForm.houseRoad;
      houseSpace = this.communityForm.houseSpace;

      houseSpace.forEach((item, index) => {
        if (!item.id) {
          query.houseSpace.push(item);
        }
      });
      houseOffice.forEach((item, index) => {
        if (!item.id) {
          query.houseOffice.push(item);
        }
      });
      houseRoad.forEach((item, index) => {
        if (!item.id) {
          query.houseRoad.push(item);
        }
      });
      houseAPI
        .createCommunit(query)
        .then(response => {
          this.office = new Object();
          this.road = new Object();
          this.officeList = [];
          this.roadList = [];
        })
        .catch(err => {
          console.log("创建房源====>", err);
        });
    },
    addOfficeRoad() {},
    // 编辑楼盘房源
    updateBuiHouse(optType) {
      let msg = "确定更新此房源？";
      if (this.userInfo.companyType == "3") {
        msg = "当前创建房源有效期为15天，是否更新";
        this.houseForm.validateTime = vauta.getFifteen() + " 23:59:59";
      } else {
        this.houseForm.validateTime = "9999-12-31 23:59:59";
      }
      this.$confirm(msg, "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(() => {
        this.houseForm.optType = optType;
        this.houseForm.orientation = this.checkList.join(",");
        if (this.userInfo.companyType == 0 && this.isFlag==1) {
          let floorRoom = this.floorRoom.split("-");
          this.houseForm.floorNo = floorRoom[1];
          this.houseForm.roomNo = floorRoom[2];
        }
        this.houseForm.title = this.houseTitle;
        houseAPI
          .updateBuiHouse(this.houseForm)
          .then(response => {
            this.propertiesclose();
            this.$message.success(response.message);
            this.getReleaseHouse();
            this.houseForm = { imgList: [], area: "" };
            this.houseOptions = [];
            this.buildingName = "";
            this.floorRoom = "";
          })
          .catch(err => {
            this.$message.warning("更新失败，请检查信息是否填写正确！");
            console.log("编辑楼盘房源=====>", err);
          });
      });
    },

    // 更新联合办公房源
    updateHouseList() {
      this.$confirm("确定更新此房源?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(() => {
        let query = {
          brandId: this.communityForm.brandId,
          communityId: this.communityForm.communityId,
          houseSpace: [],
          houseOffice: [],
          houseRoad: []
        };
        let houseOffice = [],
          houseRoad = [],
          houseSpace = [];
        houseOffice = this.communityForm.houseOffice;
        houseRoad = this.communityForm.houseRoad;
        houseSpace = this.communityForm.houseSpace;

        if (houseSpace[0] != undefined) {
          this.fixSeat.type = "1";
          houseSpace[0] = this.fixSeat;
        }
        if (houseSpace[1] != undefined) {
          this.openSeat.type = "2";
          houseSpace[1] = this.openSeat;
        }
        this.addCommunity();

        houseSpace.forEach((item, index) => {
          if (item.id) {
            query.houseSpace.push(item);
          }
        });
        houseOffice.forEach((item, index) => {
          if (item.id) {
            query.houseOffice.push(item);
          }
        });
        houseRoad.forEach((item, index) => {
          if (item.id) {
            query.houseRoad.push(item);
          }
        });
        this.delOffice.forEach((element, index) => {
          this.houseDelete(element.id, element.type);
        });
        this.delRoad.forEach((element, index) => {
          this.houseDelete(element.id, element.type);
        });
        houseAPI
          .updateHouseList(query)
          .then(response => {
            this.housingunionclose();
            this.getReleaseCommunity();
            this.$message.success(response.message);
            this.delOffice = [];
            this.delRoad = [];
          })
          .catch(err => {
            console.log("编辑联合办公房源=====>", err);
          });
      });
    },
    // 查看楼盘房源详情
    viewBuiHouse(row, type) {
      if (this.userInfo.companyType == -1) {
        this.$alert("您还未进行公司认证", "温馨提示", {
          confirmButtonText: "去认证",
          callback: action => {
            this.$router.push({
              path: "/Home/Authentication"
            });
          }
        });
        return;
      }
      houseAPI
        .viewBuiHouse({ houseId: row.houseId })
        .then(response => {
          this.addproperties(type);
          this.isFlag = row.buildingFlag;
          this.houseForm = response.data;
          this.houseForm.houseId = row.houseId;
          this.buildingId = response.data.buildingId;
          this.buildingName = response.data.buildingName;
          this.getBuildingFloorInfo(response.data.buildingId);
          if (this.userInfo && this.userInfo.companyType != 3) {
            this.houseOptions.push(
              response.data.buildingNo,
              response.data.floorNo,
              response.data.roomNo
            );
          } else {
            this.houseOptions.push(
              response.data.buildingNo,
              response.data.floorNo
            );
          }
          this.checkList = response.data.orientation.split(",");
          // if (this.userInfo.companyType == 0) {
          //   this.houseOptions.push(response.data.buildingNo);
          // } else if (
          //   this.userInfo.companyType == 1 ||
          //   this.userInfo.companyType == 3
          // ) {
          //   this.houseOptions.push(
          //     response.data.buildingNo,
          //     response.data.floorNo,
          //     response.data.roomNo
          //   );
          // }
          this.houseTitle = response.data.title;
          if (response.data.floorNo || response.data.roomNo) {
            this.floorRoom = `${response.data.buildingNo}-${response.data.floorNo}-${response.data.roomNo}`;
          }
        })
        .catch(err => {
          console.log("查看楼盘房源详情=====>", err);
        });
    },
    // 查看社区 所有房源详情
    getHouseList(communityId, type) {
      if (this.userInfo.companyType == -1) {
        this.$alert("您还未进行公司认证", "温馨提示", {
          confirmButtonText: "去认证",
          callback: action => {
            this.$router.push({
              path: "/Home/Authentication"
            });
          }
        });
        return;
      }
      this.addunion(type);
      houseAPI
        .getHouseList({ communityId: communityId })
        .then(response => {
          this.isSeat = type;
          this.communityForm.optType = "1";
          this.communityForm = response.data;
          if (response.data.houseSpace.length > 0) {
            this.fixSeat = response.data.houseSpace[0];
          }
          if (response.data.houseSpace.length > 1) {
            this.openSeat = response.data.houseSpace[1];
          }
          this.brandName = response.data.brandName;
          this.communityName = response.data.communityName;
        })
        .catch(err => {
          console.log("查看社区 所有房源详情======>", err);
        });
    },
    inputNumber(e){
       e.target.value = (e.target.value.match(/^\d+$|^\d*\.\d+$/g)) || null
    },
    judgeArea(area) {
      const reg = /^\d+$|^\d*\.\d+$/g;
      if (!reg.test(area) && area.length > 0) {
        this.$message.warning("房源面积仅可填数字");
        this.houseForm.area = 0;
        this.changeHouseTitle();
        return;
      }
      this.changeHouseTitle();
    },
    // 楼层-房号判断
    judgeBuildRoom() {
      const isChat = this.floorRoom.substr(this.floorRoom.length - 1, 1);
      if (!this.floorRoom) {
        this.$message.warning("请输入楼层-房号");
        return false;
      } else if (this.floorRoom.indexOf("-") < 0 || isChat == "-") {
        this.$message.warning("楼层-房号格式输入不正确，请重新输入！");
        return false;
      } else {
        let floorRoom = this.floorRoom.split("-");
        this.houseForm.floorNo = floorRoom[1];
        this.houseForm.roomNo = floorRoom[2];
        this.changeHouseTitle();
      }
      return true;
    },
    //获取用户已发布房源和全部房源
    getCountUserHouse() {
      houseAPI.getCountUserHouse().then(res => {
        this.countUserHouseArr = res.data;
      });
    },
    // 进入创建房源页
    addproperties(type) {
      if (this.userInfo.companyType == 3) {
        this.getCountUserHouse();
      }
      if (this.userInfo.companyType == -1) {
        this.$alert("您还未进行公司认证", "温馨提示", {
          confirmButtonText: "去认证",
          callback: action => {
            this.$router.push({
              path: "/Home/Authentication"
            });
          }
        });
        return;
      }
      this.isFlag = 2;
      this.isCreate = type;
      if (this.userInfo.companyType == 1) {
        this.getDeveloperBuilding();
      }
      if (type === 0) {
        this.houseForm = { imgList: [], area: "" };
        this.houseOptions = [];
        this.buildingName = "";
        this.floorRoom = "";
        this.houseTitle = "";
      }
      (this.housing = false),
        (this.housingpropertiesadd = true),
        (this.housingunionadd = false);
    },
    // 创建联合办公跳转
    addunion(type) {
      if (this.userInfo.companyType == -1) {
        this.$alert("您还未进行公司认证", "温馨提示", {
          confirmButtonText: "去认证",
          callback: action => {
            this.$router.push({
              path: "/Home/Authentication"
            });
          }
        });
        return;
      } else if (this.userInfo.companyType != 0) {
        this.$message.warning("您的账户无权限");
      }
      this.isSeat = type;
      this.communityForm = {
        houseSpace: [],
        houseOffice: [],
        houseRoad: []
      };
      this.fixSeat = {};
      this.openSeat = {};
      this.brandName = "";
      this.communityName = "";
      this.delOffice = [];
      this.delRoad = [];
      (this.housing = false),
        (this.housingpropertiesadd = false),
        (this.housingunionadd = true);
    },
    // 自动填充房源标题
    changeHouseTitle() {
      // this.houseForm.floorNo == undefined
      //   ? ""
      //   : `| ${this.houseForm.floorNo}层`;
      console.log(this.houseForm);
      let floor = "",
        buildingNo = "",
        area = "";
      let letter = /[a-zA-Z]/,
        number = /[0-9]/;

      if (this.houseForm.floorNo) {
        floor = `| ${this.houseForm.floorNo}层`;
      }
      if (this.houseForm.buildingNo) {
        if (
          this.houseForm.buildingNo.indexOf("单体") > -1 ||
          this.houseForm.buildingNo.indexOf("楼座") > -1
        ) {
          buildingNo = "";
        } else if (letter.test(this.houseForm.buildingNo)) {
          buildingNo = `| ${this.houseForm.buildingNo}座 `;
        } else if (number.test(this.houseForm.buildingNo)) {
          buildingNo = `| ${this.houseForm.buildingNo}号楼 `;
        }
      }
      if (this.houseForm.area) {
        area = `| ${this.houseForm.area}㎡ `;
      }
      this.houseForm.buildingNo == undefined
        ? ""
        : `| ${this.houseForm.buildingNo}`;

      if (this.houseForm.buildingId) {
        this.houseTitle = this.buildingName;
      }
      if (this.houseForm.area) {
        this.houseTitle = `${this.buildingName} ${area}`;
      }
      if (this.houseForm.buildingNo) {
        this.houseTitle = `${this.buildingName} ${area} ${buildingNo}`;
      }
      if (this.houseForm.floorNo) {
        this.houseTitle = `${this.buildingName} ${area} ${floor} ${buildingNo}`;
      }
      // if (this.houseForm.area) {
      //   this.houseTitle = `${this.buildingName} ${buildingNo} ${floor} | ${
      //     this.houseForm.area
      //   }㎡ `;
      // }
    },
    housingunionclose() {
      (this.housing = true),
        (this.housingpropertiesadd = false),
        (this.housingunionadd = false);
    },
    propertiesclose() {
      (this.housing = true),
        (this.housingpropertiesadd = false),
        (this.housingunionadd = false);
    }
  },
  destroyed() {
    window.removeEventListener("scroll", this.handleScroll); //  离开页面清除（移除）滚轮滚动事件
  },
  watch: {
    "houseForm.area": function area(newValue, oldValue) {
      let minNum = 0;
      var area = this.houseForm.area;
      if (!newValue) minNum = 0;
      else minNum = parseInt(parseInt(area) / 10);
      this.minStation = minNum;
      let maxNum = 0;
      if (!this.houseForm.area) maxNum = 0;
      else maxNum = parseInt(parseInt(area) / 4);
      this.maxStation = maxNum;
    },
    minStation(newValue, oldValue) {
      this.houseForm.minStation = newValue;
    },
    maxStation(newValue, oldValue) {
      this.houseForm.maxStation = newValue;
    }
  }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="scss">
.housing {
  padding: 25px;
  height: auto;
  overflow: auto;
}
/*我的房源tab切换*/
.housing-tab {
  display: flex;
}
.housing-tab .active {
  background: #ffffff;
  color: #009fe8;
}
.housing-tab-list {
  cursor: pointer;
  width: 150px;
  background: #f2f4f6;
  color: #778ca2;
  font-size: 14px;
  height: 40px;
  line-height: 40px;
  text-align: center;
}
/*楼盘*/
.housing-properties-cont {
  background: #ffffff;
  padding: 30px 30px;
}
.housing-list-tab {
  display: flex;
  background: #ffffff;
  position: relative;
}
.search {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: absolute;
  top: 0;
  right: 25px;
}
.search-bt {
  margin-left: 15px;
}
.housing-list-tab .acitvelist {
  color: #009fe8;
}
.housing-list-tab .acitvelist:after {
  content: "";
  width: 80px;
  height: 2px;
  margin: 5px auto;
  display: block;
  background: #009fe8;
}
.housing-list-tab-item {
  cursor: pointer;
  width: 135px;
  text-align: center;
  font-size: 14px;
  color: #778ca2;
}
.housing-properties-title {
  font-size: 14px;
  color: #778ca2;
  padding-top: 30px;
}
.housing-properties-tab {
  border: 1px solid #ebeef5;
  border-bottom: none;
  margin-top: 20px;
}
.housing-properties-page {
  display: flex;
  justify-content: center;
  padding: 35px 0 15px 0;
}
/deep/.el-pagination.is-background .el-pager li:not(.disabled).active {
  background-color: #009fe8;
}
/*联合办公*/
.housing-union-cont {
  background: #ffffff;
  padding: 30px 30px;
}
/*创建房源样式*/
.housing-properties-add {
  background: #ffffff;
  padding: 30px 40px;
}
.housing-properties-add-title {
  font-size: 14px;
  color: #778ca2;
}
.housing-properties-form {
  padding: 30px 0;
}
.housing-properties-flex {
  display: flex;
}
.housing-properties-text {
  width: 100px;
  text-align: left;
  padding-left: 20px;
}
.housing-properties-footer {
  // display: flex;
  margin-top: 15px;
  overflow: hidden;
}
.housing-properties-img {
  height: 148px;
  width: 148px;
  float: left;
  // border: 1px solid #e8ecef;
  border-radius: 3px;
  padding: 15px 15px;
  position: relative;
}
.housing-properties-img:nth-child(5n + 5) {
  margin-right: 0px;
}
.housing-properties-img > img {
  width: 100%;
  height: 100%;
  border-radius: 3px;
}
.housing-properties-img:hover .house-delete {
  display: block;
}
.house-delete {
  position: absolute;
  top: 15px;
  left: 15px;
  width: 148px;
  height: 148px;
  background: #000;
  border-radius: 5px;
  opacity: 0.5;
  display: none;
  color: #fff;
  font-size: 35px;
  line-height: 148px;
  text-align: center;
  cursor: pointer;
}
.housing-properties-bt {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 30px;
}
/deep/ .el-form-item {
  margin-right: 50px;
}
/deep/ .el-form-item__label {
  text-align: left;
}
/deep/ .el-form-item__content {
  display: flex;
}
/deep/ .el-textarea__inner {
  height: 100px;
  resize: none;
}
.house-title {
  width: 170px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
/*创建联合办公样式*/
.housing-union-add {
  background: #ffffff;
  padding: 30px 40px;
}
.housing-union-add-title {
  font-size: 14px;
  color: #778ca2;
}
.housing-union-add-center {
  white-space: nowrap;
  display: flex;
  flex-wrap: wrap;
  margin-top: 20px;
  background: #ffffff;
}
.housing-union-add-list {
  width: 265px;
  border-radius: 10px;
  background: #ffffff;
  margin-right: 40px;
  margin-bottom: 35px;
  box-shadow: 0px 0px 20px 2px rgba(0, 0, 0, 0.1);
}
.housing-union-add-list:last-child {
  margin-right: 0px;
}
.housing-union-add-list-img > img {
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  height: 170px;
}
.housing-union-add-list-title {
  display: flex;
  align-items: center;
  color: #333333;
  font-size: 14px;
  margin-top: 10px;
  padding: 0 15px;
}
.housing-union-add-list-title > span {
  font-size: 12px;
  color: #333333;
  padding-left: 15px;
}
.housing-union-add-list-cont {
  font-size: 12px;
  color: #333333;
  padding: 0 15px;
  display: flex;
  align-items: center;
  margin-top: 10px;
}
.housing-union-add-list-bt {
  display: flex;
  padding: 10px 15px;
  align-items: center;
  justify-content: space-between;
}
.housing-union-add-list-bt-name {
  font-size: 12px;
  color: #666666;
}
.housing-union-add-list-bt-name > span {
  font-size: 18px;
  color: #39b4ff;
  margin-right: 5px;
}
.housing-union-add-list-bt-img {
  width: 20px;
  height: 20px;
}
/*弹窗*/
/deep/ .el-dialog__body {
  background: #f8fafb;
}
.upload-list {
  width: 148px;
  height: 148px;
  border-radius: 5px;
  margin-right: 15px;
  border: 1px dashed #ccc;
  img {
    width: 100%;
    height: 100%;
    border-radius: 5px;
  }
}
.seat-upload {
  margin-right: 15px;
  position: relative;
  border-radius: 5px;
  img {
    border-radius: 5px;
  }
  // .seat-list{
  //   width:148px;
  //   height:148px;
  //   border-radius: 5px;
  //   border:1px dashed #ccc;
  // }
}
.upload-delete {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 144px;
  background: #000;
  border-radius: 5px;
  opacity: 0.5;
  display: none;
  color: #fff;
  font-size: 35px;
  line-height: 144px;
  text-align: center;
  cursor: pointer;
}
.seat-upload:hover > .upload-delete {
  display: block;
}
.shuxin {
  padding-left: 30px;
  padding-top: 20px;
}
.shuxin p {
  font-size: 13px;
  color: #778ca2;
  line-height: 25px;
  letter-spacing: 2px;
  color: #606266;
}
</style>
